﻿define('api/pointService', [], function() {


	return {
		
		getPointCountByArea:function(callback){
			ajaxProcess({
	            url : '/pls/gis/point/city/pointquantity',
	            requestType : 'POST',
	            data : {},
	            successHandle : function(data) {
	            	if(callback && typeof callback === 'function') {
	            		callback(data);
	            	}
	            }
	        });
		},
		
		getPointCountByTrade:function(callback){
			ajaxProcess({
	            url : '/pls/gis/point/tradecode/pointquantity',
	            requestType : 'POST',
	            data : {},
	            successHandle : function(data) {
	            	if(callback && typeof callback === 'function') {
	            		callback(data);
	            	}
	            }
	        });
		},
		
		getPointCountByControlLevel:function(callback){
			ajaxProcess({
	            url : '/pls/gis/point/controllevel/pointquantity',
	            requestType : 'POST',
	            data : {},
	            successHandle : function(data) {
	            	if(callback && typeof callback === 'function') {
	            		callback(data);
	            	}
	            }
	        });
		},
		
		getPointInfoByCode: function(param, callback){
			var _url = param.pointType=='air'?
					'/pls/gis/point/airpointcode':
					'/pls/gis/point/waterpointcode';
			ajaxProcess({
	            url : _url,
	            requestType : 'POST',
	            data : {
	            	pointcode: param.pointcode
	            },
	            successHandle : function(res) {
	            	if(callback && typeof callback === 'function') {
	            		callback(res);
	            	}
	            }
	        });
		},
		
		getPointRealTimeDataByCode: function(param, callback){
			ajaxProcess({
	            url : '/pls/gis/point/twentyFour',
	            requestType : 'POST',
	            data : {
	            	pointcode: param.pointcode,
	            	currenttime: '2018-1-14 12:51:00',
	            	pointType: 'air'
	            },
	            successHandle : function(res) {
	            	if(callback && typeof callback === 'function') {
	            		callback(res);
	            	}
	            }
	        });
		}
	};
	
});
